//package hi.scrap;
//
//import hi.Hiout;
//import hi.Hiout.TrackData;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.net.InetAddress;
//import java.net.Socket;
//import java.net.UnknownHostException;
//
//import javax.swing.JFrame;
//import javax.swing.JPanel;
//
//public class AlphaCursorClient {
//	static int portnum = 24312; //randomly chosen
//	
//    public static void main(String[] args) throws IOException {
//		
//		JFrame aWindow = new JFrame("This is the Window Title");
//		int windowWidth = 640;           // Window width in pixels
//		int windowHeight = 480;          // Window height in pixels
//		aWindow.setBounds(50, 100,       // Set position
//						  windowWidth, windowHeight);  // and size
//		aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//		
//		TrackerPanel trackerPanel = new TrackerPanel();
//		
//		aWindow.setContentPane(trackerPanel);
//
//		aWindow.setVisible(true);        // Display the window
//		
//		Socket trackerSocket = null;
//		System.err.println("DEBUG");
//        try {
//			System.err.println("DEBUG0");
//			trackerSocket = new Socket(InetAddress.getLocalHost(), portnum);
//			System.err.println("DEBUG1");
//			
//			InputStream inStream = trackerSocket.getInputStream();
//			
//			while (true) {
//				TrackData trackData = TrackData.parseDelimitedFrom(inStream);
//				System.out.println("active="+trackData.getActive()+" x="+trackData.getX()+" y="+trackData.getY());
//				
//				trackerPanel.moveCursorTo(trackData.getX()*4, trackData.getY()*4);
//				
//			}
//		} catch (UnknownHostException e) {
//            System.err.println("Can't find localhost");
//            System.exit(1);
//        } catch (IOException e) {
//            System.err.println("Couldn't get I/O for "
//                               + "the connection to: localhost.");
//            System.exit(1);
//        } finally {
//			System.err.println("DEBUG3");
//			if (trackerSocket != null) {
//				trackerSocket.close();
//			}
//		}
//    }
//}